import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class streamDemo {
    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();
        list.add("A");
        list.add("B");
        list.add("C");
        list.add("D");
        list.add("E");
        list.add("E");

        List<String> newList2 = list.stream().filter(obj->obj.startsWith("A")).collect(Collectors.toList());
        System.out.println(newList2);

    }
}
